<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<body>
<ui:composition template="../template/templateAutenticado.xhtml">
	<ui:define name="central">
	<div align="center">
		<div align="left">
			<h:form>
				<h:commandLink action="PrincipalProfessor">
					<h:graphicImage value="/imagens/voltar.png" width="48" height="48" style="border:0px;"/>
				</h:commandLink>
			</h:form>
		</div>
		<br/>
		
		<h:form id="formListaAlunos">
			<rich:dataTable value="#{Professor.alunos}" var="aluno" width="800px" rows="10" reRender="datascroller">
				<f:facet name="header">
					<h:outputText value="#{msg.ListarAlunos}" />
				</f:facet>
				<rich:column sortBy="#{aluno.codigo}">
					<f:facet name="header">
						<h:outputText value="#{msg.Codigo}" />
					</f:facet>
					<h:outputText value="#{aluno.codigo}"/>
				</rich:column>
				<rich:column sortBy="#{aluno.dataAniversario}">
					<f:facet name="header">
						<h:outputText value="#{msg.DataNascimento}" />
					</f:facet>
					<h:outputText value="#{aluno.dataAniversario.time}">
						<f:convertDateTime type="date" pattern="dd/MM/yyyy"/>
					</h:outputText>
				</rich:column>
				<rich:column sortBy="#{aluno.nomeCompleto}">
					<f:facet name="header">
						<h:outputText value="#{msg.NomeAluno}" />
					</f:facet>
					<h:outputText value="#{aluno.nomeCompleto}" />
				</rich:column>
				<rich:column sortBy="#{aluno.login}">
					<f:facet name="header">
						<h:outputText value="#{msg.Email}" />
					</f:facet>
					<h:outputText value="#{aluno.login}" />
				</rich:column>
				<rich:column sortBy="#{aluno.nomeMae}">
					<f:facet name="header">
						<h:outputText value="#{msg.NomeMae}" />
					</f:facet>
					<h:outputText value="#{aluno.nomeMae}"/>
				</rich:column>
				<rich:column sortBy="#{aluno.turma}">
					<f:facet name="header">
						<h:outputText value="#{msg.Turma}" />
					</f:facet>
					<h:outputText value="#{aluno.turma}"/>
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.Senha}" />
					</f:facet>
						<h:commandLink onclick="return confirm('Deseja realmente resetar a senha deste aluno?');" action="#{Professor.limpaSenha}">
							<f:param name="Codigo" value="#{aluno.codigo}"/>
							<h:outputText value="#{msg.ResetSenha}" />
						</h:commandLink>
				</rich:column>
				<f:facet name="footer">
                	<rich:datascroller id="datascroller" />
            	</f:facet>
			</rich:dataTable>
		</h:form>
	</div>
	</ui:define>
</ui:composition>
</body>
</html>
